use mongodb::{Client, options::ClientOptions};
fn main() {

    // Parse a connection string into an options struct.
    let mut client_options = ClientOptions::parse("mongodb://localhost:27017").ok().expect("连接失败");

// Manually set an option.
    client_options.app_name = Some("My App".to_string());

// Get a handle to the deployment.
    let client = Client::with_options(client_options).expect("未找到相应数据库");

// List the names of the databases in that deployment.
    for db_name in client.list_database_names(None).expect("获取失败") {
        println!("{}", db_name);
    }
}

